package car.Postal.Grimentz;

import java.util.ArrayList;
import java.util.List;

import android.os.Handler;

/**
 * Simple handler including constants and helpers to facilitate communicating
 * state about a file download.
 */
public abstract class MapActivityHandler extends Handler
{
	public static final int MSG_SET_LENGTH = 0;
	public static final int MSG_ON_RECV = 1;
	public static final int MSG_FINISHED = 2;
	public static final int MSG_ERROR = 3;
	public static final int MSG_ABORTED = 4;
	public static final int MSG_SET_STATIONS = 5;
	public static final int MSG_SET_UPDATE_PROMO = 6;

	public void sendSetLength(long length)
	{
		sendMessage(obtainMessage(MSG_SET_LENGTH, (Long)length));	
	}

	public void sendOnRecv(String recvd)
	{
		sendMessage(obtainMessage(MSG_ON_RECV, (String)recvd));
	}

	public void sendFinished()
	{
		sendMessage(obtainMessage(MSG_FINISHED));
	}

	public void sendError(String errmsg)
	{
		sendMessage(obtainMessage(MSG_ERROR, errmsg));
	}

	public void sendAborted()
	{
		sendMessage(obtainMessage(MSG_ABORTED));
	}

	public void sendPayload(ArrayList<OverlayItem> liste) {
		sendMessage(obtainMessage(MSG_SET_STATIONS, (ArrayList<OverlayItem>)liste));	
	}


}
